#include "StdAfx.h"
#include "dmanageclassdlg.h"
#include "dmanagevariabledlg.h"

#include "dclassentity.h"
#include "dmethodentity.h"
#include "dvariableentity.h"
#include "dvariabletablemodel.h"

DManageClassDlg::DManageClassDlg(DClassEntity* pClass, QWidget *parent)
	: QDialog(parent)
	, m_pClass(pClass)
{
	ui.setupUi(this);

	// copy members to temp and fill

	foreach(DVariableEntity* pVar, m_pClass->variables())
	{
		m_tempVariables.append(pVar);
	}

	foreach(DMethodEntity* pMethod, m_pClass->methods())
	{
		m_tempMethods.append(pMethod);
	}

	m_pVarModel = new DVariableTableModel(m_tempVariables);
	ui.tableViewVariables->setModel(m_pVarModel);
}

DManageClassDlg::~DManageClassDlg()
{

}

void DManageClassDlg::onAddMethod()
{

}

void DManageClassDlg::onModifyMethod()
{

}

void DManageClassDlg::onRemoveMethod()
{

}

void DManageClassDlg::onAddVariable()
{
	DManageVariableDlg dlg;
	if(dlg.exec() == QDialog::Accepted)
	{

	}
}

void DManageClassDlg::onModifyVariable()
{

}

void DManageClassDlg::onRemoveVariable()
{

}
